home *** CD-ROM | disk | FTP | other *** search
/ Aminet 16 / Aminet 16 (1996)(GTI - Schatztruhe)[!][Dec 1996].iso / Aminet / dev / src / wangisrc.lha / wangi / z / wpad_library / WPP_Init.c < prev    next >
C/C++ Source or Header  |  1995-08-27  |  996b  |  52 lines

  1. /***************************************************************************
  2.  * WPP_Init.c
  3.  *
  4.  * wpad.library, Copyright ©1995 Lee Kindness.
  5.  *
  6.  * 
  7.  */
  8.  
  9. #include "wpad_global.h"
  10.  
  11. BOOL WPP_Init( VOID )
  12. {
  13.     if(SysBase)
  14.         return(TRUE);
  15.     else
  16.     {
  17.         SysBase = *(struct ExecBase **)4;
  18.  
  19.         if(SysBase -> LibNode . lib_Version < 37)
  20.         {
  21.             SysBase = NULL;
  22.  
  23.             return(FALSE);
  24.         }
  25.         else
  26.         {
  27.  
  28.             DOSBase = (struct DosLibrary *)OpenLibrary("dos.library", 37);
  29.             IntuitionBase    = OpenLibrary("intuition.library",37);
  30.             GfxBase = (struct GfxBase *)OpenLibrary("graphics.library",37);
  31.             UtilityBase    = OpenLibrary("utility.library",37);
  32.             GadToolsBase = OpenLibrary("gadtools.library",37);
  33.             DiskfontBase = OpenLibrary("diskfont.library", 0);
  34.             CxBase = OpenLibrary("commodities.library", 37);
  35.  
  36.             if( DOSBase && 
  37.                 IntuitionBase && 
  38.                 GfxBase && 
  39.                 UtilityBase && 
  40.                 GadToolsBase &&
  41.                 DiskfontBase &&
  42.                 CxBase )
  43.                 return(TRUE);
  44.             
  45.             WPP_Exit();
  46.  
  47.             return(FALSE);
  48.         }
  49.     }
  50. }
  51.  
  52.